#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;

class Solution {
public:
    bool repeatedSubstringPattern(string s) {
        string ss = s+s;
        ss.erase(ss.begin());
        ss.erase(ss.end()-1);
        return ss.find(s)!=std::string::npos;
    }
};